package org.zoomdev.zoom.lock.modules;

import java.util.concurrent.atomic.AtomicBoolean;

class CasPool extends DefaultKeyedObjectPool<AtomicBoolean> {
    private static CasPool pool;

    static CasPool getPool() {
        if (pool == null) {
            synchronized (CasPool.class) {
                if (pool == null) {
                    pool = new CasPool();
                }
            }

        }
        return pool;
    }

    @Override
    protected void initObject(AtomicBoolean data, String key) {

    }

    @Override
    protected AtomicBoolean createObject(String key) {
        return new AtomicBoolean(false);
    }

    @Override
    protected AtomicBoolean clearObject(AtomicBoolean data, String key) {
        return data;
    }
}
